/**
 * Created by oiuyt on 2018/7/18.
 */
import React, { Component } from 'react';

class Test2 extends Component {
/*
    调用super的原因：在ES6中，在子类的constructor中必须先调用super才能引用this
    super(props)的目的：在constructor中可以使用this.props
    */
    constructor(props) {
        super(props);
        console.log(this.props)
        console.log(props)
        console.log("组件初始化")
    }
    render() {
        return (
            <div>
                <h3>获取Url{`${this.props.match.url}`} </h3>
                <h4>获取query{`${ this.props.location.search}`} </h4>

            </div>
        )
    }
}


export default Test2
